package com.xinhua.control;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.xinhua.entity.Courses;
import com.xinhua.entity.Major;
import com.xinhua.entity.Period;
import com.xinhua.entity.Student;
import com.xinhua.entity.SurveyContent;
import com.xinhua.entity.SurveyDetail;
import com.xinhua.entity.SurveyItem;
import com.xinhua.entity.Teacher;
import com.xinhua.service.CoursesService;
import com.xinhua.service.MajorService;
import com.xinhua.service.PeriodService;
import com.xinhua.service.StudentService;
import com.xinhua.service.SurveyContentService;
import com.xinhua.service.SurveyDetailService;
import com.xinhua.service.SurveyItemService;
import com.xinhua.service.TeacherService;

@RestController
public class DeleteManager {
	private List<SurveyItem> sitem;
	private List<Major> major;
	private List<Courses> course;
	private List<Teacher> teach;
	private List<SurveyDetail> sdetail;
	private List<Student> student;
	private List<Period> periods;
	private List<SurveyContent> surconts;

	@Autowired
	private SurveyItemService sis;
	@Autowired
	private SurveyContentService scs;
	@Autowired
	private MajorService ms;
	@Autowired
	private CoursesService cs;
	@Autowired
	private TeacherService ts;
	@Autowired
	private SurveyDetailService sdc;
	@Autowired
	private StudentService ss;
	@Autowired
	private PeriodService ps;

	@RequestMapping("/SetDeleteHtml")
	public void setDeleteHtml(HttpServletRequest req, @RequestParam("deleteid") String deleteid) {
		HttpSession session = req.getSession(true);
		session.setAttribute("deleteid", deleteid);
	}

	@RequestMapping("/GetDeleteHtml")
	public String getDeleteHtml(HttpServletRequest req) {
		HttpSession session = req.getSession();
		String deleteid = (String) session.getAttribute("deleteid");
		String deleteText = null;
		switch (deleteid) {
		case "0":
			deleteText = deleteid;
			break;
		case "1":
			deleteText = deleteid;
			break;
		case "2":
			deleteText = deleteid;
			break;
		case "3":
			deleteText = deleteid;
			break;
		case "4":
			deleteText = deleteid;
			break;
		case "5":
			deleteText = deleteid;
			break;
		case "6":
			deleteText = deleteid;
			break;
		default:
			break;
		}
		return deleteText;
	}

}
